﻿namespace Core
{
    /// <summary>
    /// 百分比属性设置
    /// </summary>
    [Buff]
    public class AddPercentAttributeBuff : BuffSystem
    {
        protected override void OnAwake()
        {
            int.TryParse(config.param1, out var changeName);
            int.TryParse(config.param2, out var valueName);
            float.TryParse(config.param3, out var value);

            var component = target.GetComponent<NumericComponent>();
            component[changeName] += (long)(component[valueName] * value);
            this.Dispose();
        }
    }
}